﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wizard.Source
{
    public interface IWizardApplication
    {
        //Wizard.Engine.IWizardEngine Engine { get; }
        IClassSource GetClassSource(string className);
        int ApplicationId { get; }
        string ApplicationName { get; }


        ISourceFile[] GetSourceFiles();
        ISourceFile NewSourceFile(Wizard.IDataStore dataStore, string sourceFileName);
        void DeleteSourceFile(Wizard.IDataStore dataStore, int p);
        Wizard.Runtime.IClassInstance Instantiate(Wizard.IDataStore dataStore);
        void Update(Wizard.IDataStore iDataStore, string applicationName);
        void DeleteClassSources(Wizard.IDataStore dataStore);
    }
    //public class Application
    //{
    //    public readonly IWizardEngine mEngine;
    //    public readonly string Name;
    //    public readonly ClassSourceCollection Classes;

    //    internal Application(IWizardEngine engine, string fullname)
    //    {
    //        mEngine = engine;
    //        Name = fullname;
    //        Classes = new ClassSourceCollection(this);
    //    }
    //}

    //public class NamespaceCollection
    //{
    //    private IWizardEngine mEngine;
    //    private Dictionary<string, Application> mNamespaces;

    //    internal NamespaceCollection(IWizardEngine engine)
    //    {
    //        mNamespaces = new Dictionary<string, Application>(System.StringComparer.OrdinalIgnoreCase);
    //        mEngine = engine;
    //    }

    //    public bool TryGetValue(string key, out Application value)
    //    {
    //        return mNamespaces.TryGetValue(key, out value);
    //    }

    //    public Application Add(string fullname)
    //    {
    //        Application result = new Application(mEngine, fullname);
    //        mNamespaces.Add(fullname, result);
    //        return result;
    //    }
    //}

}
